#include <sys/types.h>
#include <stdio.h>
#include <time.h>
#include "merc.h"
#include "magic.h"
#include "interp.h"

/*
 * Liquid properties.
 * Used in world.obj.
 */
const   struct  material_type   material_table  []	=
{
/* Name			Phase		Hardn.	Rarity	Conduc. Flamm.  Density	Flags	*/
{ "none",		MAT_SOLID,	0,		0,		0,		0, 		0,		0},
{ "flesh",		MAT_SOLID,	1,		1,		0,		1,		0,		0},
{ "moss",		MAT_SOLID,	1,		1,		0,		1,		0,		0},
{ "slime",		MAT_PLASMA, 0,   	1,		0,		0,		1,		MAT_TRANSLUCENT},
{ "jelly",		MAT_PLASMA,	0,     	2,		0,		0,		1,		MAT_TRANSLUCENT},
{ "wax",		MAT_SOLID,  1, 		1, 		0,		0,		0,		MAT_TRANSLUCENT},
{ "oil",		MAT_LIQUID,	0,		2,		0,		0,		0,		MAT_TRANSLUCENT},
{ "balm",		MAT_LIQUID,	0,		2,		0,		0,		1,		0},
{ "cream",		MAT_LIQUID,	0,		2,		0,		0,		1,		0},
{ "hard leather", MAT_SOLID,3,		1,		0,		1,		1,		0},
{ "leather",	MAT_SOLID,	2,		1,		0,		1,		0,		0},
{ "soft leather", MAT_SOLID,2,		1,		0,		1,		0,		0},
{ "fur",		MAT_SOLID,	2,		1,		0,		2,		1,		0},
{ "snakeskin",	MAT_SOLID,	1,		2,		0,		1,		0,		0},
{ "gut",		MAT_SOLID,	2,		1,		0,		1,		0,		0},
{ "food",		MAT_SOLID,	1,		1,		0,		1,		1,		MAT_EDIBLE},
{ "meat",		MAT_SOLID,	1,		1,		0,		1,		0,		MAT_EDIBLE},
{ "bread",		MAT_SOLID,	1,		1,		0,		1,		0,		MAT_EDIBLE},
{ "wood",		MAT_SOLID,	2,		1,		0,		3,		0,		0},
{ "hardwood",	MAT_SOLID,	3,		2,		0,		3,		0,		0},
{ "softwood",	MAT_SOLID,	1,		2,		0,		3,		0,		0},
{ "bamboo",		MAT_SOLID,	2,		3,		0,		3,		0,		0},
{ "ebony",		MAT_SOLID,	3,		3,		0,		2,		1,		0},
{ "cork",		MAT_SOLID,	2,		2,		0,		3,		0,		0},
{ "horn",		MAT_SOLID,	3,		2,		0,		2,		1,		0},
{ "sponge",		MAT_SOLID,	1,		1,		0,		3,		0,		0},
{ "silk",		MAT_SOLID,	1,		2,		0,		3,		0,		MAT_TRANSLUCENT},
{ "satin",		MAT_SOLID,	1,		1,		0,		2,		0,		0},
{ "lace",		MAT_SOLID,	1,		1,		0,		2,		0,		MAT_TRANSLUCENT},
{ "wool",		MAT_SOLID,	1,		1,		0,		2,		0,		0},
{ "linen",		MAT_SOLID,	1,		1,		0,		2,		0,		0},
{ "canvas",		MAT_SOLID,	2,		1,		0,		2,		0,		0},
{ "cloth",		MAT_SOLID,	1,		1,		0,		2,		0,		0},
{ "velvet",		MAT_SOLID,	1,		1,		0,		2,		0,		0},
{ "felt",		MAT_SOLID,	1,		2,		0,		2,		0,		0},
{ "paper",		MAT_SOLID,	1,		1,		0,		3,		0,		0},
{ "parchment",	MAT_SOLID,	1,		2,		0,		3,		0,		0},
{ "vellum",		MAT_SOLID,	1,		3,		0,		3,		0,		0},
{ "hemp",		MAT_SOLID,	2,		1,		0,		2,		0,		0},
{ "feathers",	MAT_SOLID,	1,		1,		0,		2,		0,		0},
{ "webbing",	MAT_SOLID,	1,		1,		0,		3,		0,		MAT_TRANSLUCENT},
{ "steel",		MAT_SOLID,	4,		1,		2,		0,		1,		0},
{ "gold",		MAT_SOLID,	3,		3,		4,		0,		1,		0},
{ "silver",		MAT_SOLID,	3,		3,		3,		0,		1,		0},
{ "mithril",	MAT_SOLID,	4,		2,		2,		0,		1,		0},
{ "platinum",	MAT_SOLID,	3,		2,		2,		0,		1,		0},
{ "iron",		MAT_SOLID,	4,		1,		4,		0,		1,		0},
{ "lead",		MAT_SOLID,	3,		1,		3,		0,		1,		0},
{ "copper",		MAT_SOLID,	3,		1,		4,		0,		1,		0},
{ "electrum",	MAT_SOLID,	3,		2,		4,		0,		1,		0},
{ "bronze",		MAT_SOLID,	3,		2,		3,		0,		1,		0},
{ "brass",		MAT_SOLID,	3,		2,		3,		0,		1,		0},
{ "wire",		MAT_SOLID,	2,		1,		4,		0,		1,		0},
{ "tin",		MAT_SOLID,	2,		1,		3,		0,		1,		0},
{ "pewter",		MAT_SOLID,	2,		2,		3,		0,		1,		0},
{ "metal",		MAT_SOLID,	3,		1,		3,		0,		1,		0},
{ "porcelain",	MAT_SOLID,	1,		3,		0,		0,		1,		0},
{ "ivory",		MAT_SOLID,	3,		3,		0,		0,		1,		0},
{ "marble",		MAT_SOLID,	4,		3,		0,		0,		1,		0},
{ "oldstyle",	MAT_SOLID,  2,  	1,	 	2,  	1, 	 	1,	  	0},
{ "stone",		MAT_SOLID,	4,		1,		0,		0,		1,		0},
{ "quartz",		MAT_SOLID,	3,		2,		0,		0,		1,		MAT_TRANSLUCENT},
{ "corundum",	MAT_SOLID,	4,		3,		0,		0,		1,		0},
{ "flint",		MAT_SOLID,	2,		2,		0,		0,		1,		0},
{ "lodestone",	MAT_SOLID,	3,		3,		2,		0,		1,		0},
{ "granite",	MAT_SOLID,	4,		1,		0,		0,		1,		0},
{ "enamel",		MAT_SOLID,	4,		3,		0,		0,		1,		0},
{ "obsidian",	MAT_SOLID,	3,		3,		0,		0,		1,		0},
{ "adamantite",	MAT_SOLID,	5,		2,		3,		0,		1,		0},
{ "glass",		MAT_SOLID,	2,		3,		0,		0,		1,		MAT_TRANSPARENT},
{ "pottery",	MAT_SOLID,	2,		3,		0,		0,		1,		0},
{ "crystal",	MAT_SOLID,	2,		4,		0,		0,		1,		MAT_TRANSPARENT},
{ "ice",		MAT_SOLID,	2,		1,		0,		0,		0,		MAT_TRANSLUCENT},
{ "bone",		MAT_SOLID,	3,		2,		0,		0,		1,		0},
{ "shell",		MAT_SOLID,	3,		3,		0,		0,		1,		0},
{ "coral",		MAT_SOLID,	3,		3,		0,		0,		1,		0},
{ "energy",		MAT_PLASMA,	1,		4,		0,		0,		0,		MAT_TRANSLUCENT},
{ "fire",		MAT_PLASMA,	0,		1,		0,		0,		0,		MAT_TRANSLUCENT},
{ "air",		MAT_GAS,	0,		1,		0,		0,		0,		MAT_TRANSPARENT},
{ "water",		MAT_LIQUID,	0,		1,		4,		0,		0,		MAT_TRANSPARENT},
{ "acid",		MAT_LIQUID,	0,		3,		4,		0,		1,		0},
{ "coal",		MAT_SOLID,	3,		2,		0,		3,		1,		0},
{ "sandstone",	MAT_SOLID,	2,			2,		0,		0,		1,		0},
{ "clay",		MAT_SOLID,	2,		2,		0,		0,		1,		0},
{ "ash",		MAT_SOLID,	1,		1,		0,		2,		1,		0},
{ "earth",		MAT_SOLID,	3,		1,		0,		0,		1,		0},
{ "diamond",	MAT_SOLID,	5,			3,		0,		0,		1,		MAT_TRANSLUCENT},
{ "etherealness",MAT_PLASMA,1,		4,		0,		0,		0,		MAT_TRANSLUCENT},
{ "nothingness",MAT_PLASMA,	0,			4,		0,		0,		0,		MAT_TRANSPARENT},
{ "dragonscale",MAT_SOLID,	5,			4,		4,		0,		1,		0},
{ "blue dragonscale",MAT_SOLID,	5,	4,		0,		0,		1,		0},
{ "black dragonscale",MAT_SOLID,5,	4,		4,		0,		1,		0},
{ "white dragonscale",MAT_SOLID,5,	4,		4,		0,		1,		0},
{ "red dragonscale",  MAT_SOLID,5,	4,		4,		0,		1,		0},
{ "heartstone",	MAT_SOLID,	5,			4,		0,		0,		1,		0},
{ "hair", 		MAT_SOLID, 	0,		0,		0,		4,		0,		0},
{ "titanium",		MAT_SOLID,	4,		3,		4,		0,		3,		0},
{ "seaweed",		MAT_SOLID,	1,		1,		0,		0,		0,		0},
{ NULL,			0,			0,		0,		0,		0,		0,		0},
};


const	struct	liq_type	liq_table	[]	=
{
/*    name					color			proof,full,thirst,food,ssize */
    { "water",				"clear",		{   0, 	1, 10, 	0, 16 }	},
    { "beer",				"amber",		{  12, 	1,  8, 	1, 12 }	},
    { "red wine",			"burgundy",		{  30, 	1,  8, 	1,  5 }	},
    { "ale",				"brown",		{  15, 	1,  8, 	1, 12 }	},
    { "dark ale",			"dark",			{  16, 	1,  8, 	1, 12 }	},	
    { "whisky",				"golden",		{ 120, 	1,  5, 	0,  2 }	},
    { "lemonade",			"pink",			{   0, 	1,  9, 	2, 12 }	},
    { "firebreather",		"boiling",		{ 190, 	0,  4, 	0,  2 }	},
    { "local specialty",	"clear",		{ 151, 	1,  3, 	0,  2 }	},
    { "slime mold juice",	"green",		{   0, 	2, -8, 	1,  2 }	},
    { "milk",				"white",		{   0, 	2,  9, 	3, 12 }	},
    { "tea",				"tan",			{   0, 	1,  8, 	0,  6 }	},
    { "coffee",				"black",		{   0, 	1,  8, 	0,  6 }	},
    { "blood",				"red",			{   0, 	2, -1, 	2,  6 }	},
    { "salt water",			"clear",		{   0, 	1, -2, 	0,  1 }	},
    { "root beer",			"brown",		{   0, 	2, 	9, 	2, 12 } },
    { "elvish wine",		"green",		{  35, 	2, 	8, 	1,  5 } },
    { "white wine",			"golden",		{  28, 	1, 	8, 	1,  5 } },
    { "champagne",			"golden",		{  32, 	1, 	8, 	1,  5 } },
    { "mead",				"honey-colored",{  34, 	2, 	8, 	2, 12 } },
    { "rose wine",			"pink",			{  26, 	1, 	8, 	1,  5 }	},
    { "benedictine wine",	"burgundy",		{  40, 	1, 	8, 	1,  5 } },
    { "vodka",				"clear",		{ 130, 	1, 	5, 	0,  2 } },
    { "cranberry juice",	"red",			{   0, 	1, 	9, 	2, 12 }	},
    { "orange juice",		"orange",		{   0, 	2, 	9, 	3, 12 } },
    { "absinthe",			"green",		{ 200, 	1, 	4, 	0,  2 }	},
    { "brandy",				"golden",		{  80, 	1, 	5, 	0,  4 }	},
    { "aquavit",			"clear",		{ 140, 	1, 	5, 	0,  2 }	},
    { "schnapps",			"clear",		{  90, 	1, 	5, 	0,  2 } },
    { "icewine",			"purple",		{  50, 	2, 	6, 	1,  5 }	},
    { "amontillado",		"burgundy",		{  35, 	2, 	8, 	1,  5 }	},
    { "sherry",				"red",			{  38, 	2, 	7, 	1,  5 } },	
    { "framboise",			"red",			{  50, 	1, 	7, 	1,  5 } },
    { "rum",				"amber",		{ 151, 	1, 	4, 	0,  2 }	},
    { "cordial",			"clear",		{ 100, 	1, 	5, 	0,  2 } },
    { NULL,					NULL,			{   0, 	0, 	0, 	0, 	0 }	}
};
